<form action="service.php" method="post">
    <input type="hidden" name="id" value="{if $object.srv_id!=0}{$object.srv_id}{else}{$object.id}{/if}"/>
    <table>
	<tr>
	    <td align="right">Услуга:</td>
	    <td>
		<select name="service_name_id">
		{foreach from=$service_names item=sn}
		    <option value="{$sn.id}" {if $object.service_name_id==$sn.id}selected{/if}>{$sn.service_name}</option>
		{/foreach}
		</select>

		{if $object.service_name_id==3}
		<table class="service-options ui-state-default" id="service-name-3">
		    <tr>
			<td align="right"><strong>Номер телефона:</strong></td>
			<td><input type="text" name="phone_number" value="{$object.phone_number}"/></td>
		    </tr>
		    <tr>
			<td align="right"><strong>Тариф:</strong></td>
			<td>
			    <select name="phone_rate_id">
			    {foreach from=$phone_rates item=rate}
				<option value="{$rate.id}" {if $rate.id==$object.phone_rate_id}selected{/if}>{$rate.rate_name}</option>
			    {/foreach}
			    </select>
			</td>
		    </tr>
		</table>
		{/if}
	    </td>
	</tr>
	<tr>
	    <td align="right">Исполнитель:</td>
	    <td>
		<select name="executive_id">
		{foreach from=$executives item=executive}
		    <option value="{$executive.id}" {if $object.executive_id==$executive.id}selected{/if}>{$executive.executive_name}</option>
		{/foreach}
		</select>
	    </td>
	</tr>
	<tr>
	    <td align="right">Стоимость:</td>
	    <td><input type="text" name="cost" value="{$object.cost}"/></td>
	</tr>
	<tr>
	    <td align="right">Ежемесячная:</td>
	    <td><input type="checkbox" name="monthly" value="1" {if $object.monthly==1}checked{/if}/></td>
	</tr>
	<tr>
	    <td align="right">Начало:</td>
	    <td><input type="text" name="start_date" value="{$object.start_date}"/></td>
	</tr>
	<tr>
	    <td align="right">Конец:</td>
	    <td><input type="text" name="stop_date" value="{$object.stop_date}"/></td>
	</tr>
	<tr>
	    <td colspan="2" align="center"><input type="submit" value="Сохранить"/></td>
	</tr>
    </table>
</form>
